package com.dj.xbirdie.adapter

import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView

class AdvancePager2Adapter(private var views:MutableList<Int>): RecyclerView.Adapter<AdvancePager2Adapter.CardViewHolder>() {
    companion object {
        var list=listOf<String>("Auth", "Will", "SSL");
    }

    class CardViewHolder(itemView: View): RecyclerView.ViewHolder(itemView) {

    }


    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CardViewHolder {
        Log.d("ViewPager2", "onCreateViewHolder: 创建ViewHolder"+viewType)
        return CardViewHolder(LayoutInflater.from(parent.context).inflate(views.get(viewType),parent,false));
    }

    override fun getItemViewType(position: Int): Int {
        return position;
    }

    override fun getItemCount(): Int {
        return list.count()
    }

    override fun onBindViewHolder(holder: CardViewHolder, position: Int) {
        Log.d("ViewPager2", "绑定ViewHolder")
    }
}

